export function getRandomItems<T>(array: T[], count: number): T[] {
  if (count > array.length) {
    count = array.length;
  }

  const shuffled = [...array];  // 创建数组的浅拷贝
  const result: T[] = [];

  for (let i = 0; i < count; i++) {
    const randomIndex = Math.floor(Math.random() * shuffled.length);
    result.push(shuffled[randomIndex]);
    shuffled.splice(randomIndex, 1);  // 移除已选中的项，避免重复
  }

  return result;
}